<tc_include file="Portal/Public/style" />
    <title>注册</title>
<tc_include file="Portal/Public/header" />
<!--header end-->
<div class="reg_box main">
    <form action="{:U('Register/doReg')}" method="post">
    <div class="reg_tit">注册</div>
    <div class="reg_center">
        <div class="tips none"></div>
        <div class="input"><input required type="text" id="tel" name="tel" placeholder="手机号"/></div>
        <div class="input"><input required type="password" id="pass" name="pass" placeholder="密码(由3-10字母，数字，下划线组成)"/></div>
        <div class="xy">我已仔细阅读并接受 <a href="javascript:;">《用户服务协议》</a></div>
        <div class="btn"><input type="submit" value="注册"/></div>
    </div>
    </form>
</div>
<tc_include file="Portal/Public/footer" />
<script>
    $("#tel").blur(function(){
        var val = $(this).val();
        if(val == ""){
            $(".tips").hide();
        }else{
            var reg = /^1[34578]\d{9}$/;
            var isTrue = reg.test(val);
            if(!isTrue){
                $(".tips").text("手机号格式不正确").show();
            }else{
                $(".tips").hide();
            }
        }
    });
    $("#pass").blur(function(){
        var val = $(this).val();
        if(val == ""){
            $(".tips").hide();
        }else{
            var reg = /^[\w1-9_]{3,9}$/;
            var isTrue = reg.test(val);
            if(!isTrue){
                $(".tips").text("密码格式不正确").show();
            }else{
                $(".tips").hide();
            }
        }
    })
</script>
</body>
</html>